<?php
/**
 * Created by PhpStorm.
 * User: stupboy
 * Date: 2018/9/3
 * Time: 11:30
 * Mail:87658989@qq.com
 */

namespace app\api\logic;

use think\Config;
use think\Db;

class Version
{
    /**
     * @param string $type
     * @return array|false|\PDOStatement|string|\think\Model
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function checkVersion($type='driver_app'){
        // passenger_app 司机APP
        $version = Db::name('version')->where('app_type',$type)->find();
        $version['oss_url'] = $version['base_url'].$version['android_name'];
        $version['url'] = Config::get('base_url').$version['android_download_path'].$version['android_name'];
        return $version;
    }
}